import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [

  // 一级路由
  // 父级
  {
    path: '/',
    name: 'Main',
    component: () => import('../views/Main.vue'),

    // 二级路由
    // 子级
    children: [
      {
        path: 'shoye',
        alias: '',
        name: 'Shoye',
        component: () => import('../views/Shoye.vue')
      },
      {
        path: 'themenu',
        alias: '',
        name: 'Themenu',
        component: () => import('../views/Themenu.vue')
      },
      {
        path: 'shoppingBags',
        alias: '',
        name: 'ShoppingBags',
        component: () => import('../views/ShoppingBags.vue')
      },
      {
        path: 'my',
        alias: '',
        name: 'My',
        component: () => import('../views/My.vue')
      },

    ]
  },
  {
    path: '/goodsDetails/:pid',
    name: 'GoodsDetails',
    component: () => import('../views/GoodsDetails.vue')
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/Login.vue')
  },
  {
    path: '/myorder',
    name: 'MyOrder',
    component: () => import('../views/MyOrder.vue')
  },
  {
    path: '/Order',
    name: 'Order',
    component: () => import('../views/Order.vue')
  },
  {
    path: '/address',
    name: 'Address',
    component: () => import('../views/Address.vue')
  },
  {
    path: '/myAddress',
    name: 'MyAddress',
    component: () => import('../views/MyAddress.vue')
  },
  {
    path: '/myLike',
    name: 'MyLike',
    component: () => import('../views/MyLike.vue')
  },
  {
    path: '/personalData',
    name: 'PersonalData',
    component: () => import('../views/PersonalData.vue')
  },
  {
    path: '/myISetUp',
    name: 'MyISetUp',
    component: () => import('../views/MyISetUp.vue')
  },
  {
    path: '/backPassword',
    name: 'BackPassword',
    component: () => import('../views/BackPassword.vue')
  },
  {
    path: '/emailVerification',
    name: 'EmailVerification',
    component: () => import('../views/EmailVerification.vue')
  },
  {
    path: '/search',
    name: 'Search',
    component: () => import('../views/Search.vue')
  },
]

const router = new VueRouter({
  mode: 'hash',
  routes
})

export default router
